package com.knowif.service;

import com.knowif.dao.OfferInterviewThanksCollectionMapper;
import com.knowif.pojo.OfferInterviewThanksCollection;
import com.knowif.pojo.OfferInterviewThanksCollectionExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Xh
 * @date ：Created in 2019/5/4 0004 21:28
 */
@Service
public class OfferInterviewThanksCollection_service {

    @Autowired
    private OfferInterviewThanksCollectionMapper offerInterviewThanksCollectionMapper;

    /**
     * 条件统计
     * @param offerInterviewThanksCollectionExample
     * @return
     */
    public int countOfferInterviewThanksCollectionByParams(OfferInterviewThanksCollectionExample offerInterviewThanksCollectionExample){
        return offerInterviewThanksCollectionMapper.countByExample(offerInterviewThanksCollectionExample);
    }

    /**
     * 通过条件删除
     * @param offerInterviewThanksCollectionExample
     * @return
     */
    public int deleteOfferInterviewThanksCollectionByParams(OfferInterviewThanksCollectionExample offerInterviewThanksCollectionExample){
        return offerInterviewThanksCollectionMapper.deleteByExample(offerInterviewThanksCollectionExample);
    }

    /**
     * 插入不为空的
     * @param offerInterviewThanksCollection
     * @return
     */
    public int saveOfferInterviewThanksCollectionNotNull(OfferInterviewThanksCollection offerInterviewThanksCollection){
        return offerInterviewThanksCollectionMapper.insertSelective(offerInterviewThanksCollection);
    }

    /**
     * 通过主键查询
     * @param primaryKey
     * @return
     */
    public OfferInterviewThanksCollection selectOfferInterviewThanksCollectionById(Integer primaryKey){
        return offerInterviewThanksCollectionMapper.selectByPrimaryKey(primaryKey);
    }

    /**
     * 通过条件更新不为空的
     * @param offerInterviewThanksCollection
     * @param offerInterviewThanksCollectionExample
     * @return
     */
    public int updateOfferInterviewThanksCollectionNotNullByParams(OfferInterviewThanksCollection offerInterviewThanksCollection, OfferInterviewThanksCollectionExample offerInterviewThanksCollectionExample){
        return offerInterviewThanksCollectionMapper.updateByExampleSelective(offerInterviewThanksCollection, offerInterviewThanksCollectionExample);
    }

    /**
     * 通过参数更新所有
     * @param offerInterviewThanksCollection
     * @param offerInterviewThanksCollectionExample
     * @return
     */
    public int updateOfferInterviewThanksCollectionByParams(OfferInterviewThanksCollection offerInterviewThanksCollection, OfferInterviewThanksCollectionExample offerInterviewThanksCollectionExample) {
        return offerInterviewThanksCollectionMapper.updateByExample(offerInterviewThanksCollection, offerInterviewThanksCollectionExample);
    }
    /**
     * OfferInterviewThanksCollection条件查询
     * @param offerInterviewThanksCollectionExample
     * @return
     */
    public List<OfferInterviewThanksCollection> selectOfferInterviewThanksCollection(OfferInterviewThanksCollectionExample offerInterviewThanksCollectionExample){
        return offerInterviewThanksCollectionMapper.selectByExample(offerInterviewThanksCollectionExample);
    }

    /**
     * 插入offerInterviewThanksCollection
     * @param offerInterviewThanksCollection
     * @return
     */
    public int saveOfferInterviewThanksCollection(OfferInterviewThanksCollection offerInterviewThanksCollection){
        return offerInterviewThanksCollectionMapper.insert(offerInterviewThanksCollection);
    }

    /**
     * 更新不为空的offerInterviewThanksCollection属性
     * @param offerInterviewThanksCollection
     * @return
     */
    public int updateOfferInterviewThanksCollectionNotNull(OfferInterviewThanksCollection offerInterviewThanksCollection){
        return offerInterviewThanksCollectionMapper.updateByPrimaryKeySelective(offerInterviewThanksCollection);
    }

    /**
     * 更新所有offerInterviewThanksCollection属性
     * @param offerInterviewThanksCollection
     * @return
     */
    public int updateOfferInterviewThanksCollection(OfferInterviewThanksCollection offerInterviewThanksCollection){
        return offerInterviewThanksCollectionMapper.updateByPrimaryKey(offerInterviewThanksCollection);
    }

    /**
     * 删除offerInterviewThanksCollection
     * @param offerInterviewThanksCollectionId
     */
    public int deleteOfferInterviewThanksCollection(int offerInterviewThanksCollectionId){
        return offerInterviewThanksCollectionMapper.deleteByPrimaryKey(offerInterviewThanksCollectionId);
    }
}
